function [res] = mpsnr(rec_cube,tru_cube,maxval)
%MPSNR 计算高光谱立方体的MPSNR
% for i=1:size(rec_cube,3)
%     PSN(i) = psnr(rec_cube(:,:,i),tru_cube(:,:,i),maxval);    
% end
% res = mean(PSN);
for i=1:size(rec_cube,3)
    MSE(i) = mean((rec_cube(:,:,i)-tru_cube(:,:,i)).^2,'all');    
end
res = 10*log(maxval*maxval/mean(MSE))/log(10);
end

